<!--
 * @Descripttion: 项目看板专户信息
 * @version: 
 * @Author: zhangfan
 * @email: 2207044692@qq.com
 * @Date: 2021-07-30 09:30:15
 * @LastEditors: zhangfan
 * @LastEditTime: 2021-08-04 17:51:13
-->

<template>
  <div class="contentBox">
    <div class="container" @click="toDetail()">
      <div class="title">
        <span>专户信息</span>
      </div>
      <div class="accountInfoList">
        <ul class="item">
          <li class="itemIcon fl">
            <span class="itemTitle">专户银行</span>
            <span class="itemContent">{{
              accountInfoObj.bankName || '0'
            }}</span>
          </li>
          <li class="itemIcon fr">
            <span class="itemTitle">专户网点</span>
            <span class="itemContent">{{
              accountInfoObj.bankSiteName || '0'
            }}</span>
          </li>
        </ul>
        <ul class="item">
          <li class="itemIcon fl">
            <span class="itemTitle">专户账号</span>
            <span class="itemContent">{{
              accountInfoObj.account | deseHandler(4, 4, '*')
            }}</span>
          </li>
          <li class="itemIcon fr">
            <span class="itemTitle">签约状态</span>
            <span class="information" v-if="accountInfoObj.signed === 1"
              >已签约</span
            >
            <span class="noInformation" v-if="accountInfoObj.signed === 0"
              >未签约</span
            >
          </li>
        </ul>
      </div>
      <div class="numberAccount">
        <ul>
          <li>
            <p class="amountzhuanghu">
              {{ accountInfoObj.payTotal | splitNumber }}万元
            </p>
            <p class="namezhuanghu">专户缴存总额</p>
          </li>
          <li>
            <p class="amountzhuanghu">
              {{ accountInfoObj.balance | splitNumber }}万元
            </p>
            <p class="namezhuanghu">专户缴存余额</p>
          </li>
          <li>
            <p class="amountzhuanghu">
              {{ accountInfoObj.shouldDisburseTotal | splitNumber }}万元
            </p>
            <p class="namezhuanghu">专户应缴金额</p>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'accountInfo',
  components: {},
  computed: {},
  data() {
    return {
      accountInfoObj: '',
    }
  },
  created() {
    this.getProjectdepositdetail()
  },
  computed: {
    projectId() {
      return this.$store.getters.eZhouprojectId
    },
  },
  watch: {
    projectId(newVal, oldVal) {
      const vm = this
      vm.getProjectdepositdetail()
    },
  },
  methods: {
    //跳转详情-工资专户
    toDetail() {
      this.$router.push({
        path: '/home/monitorProjectManagement/projectDetail',
        name: 'projectDetail',
        query: {
          projectId: this.projectId,
          activeName: 'fifth',
        },
      })
      this.$store.commit('CHANGE_SLIDER_NAME', {
        oldUrl: '/home/project/projectList',
        newUrl: this.$router.currentRoute.fullPath,
      })
    },
    getProjectdepositdetail() {
      this.axios({
        method: 'post',
        url: 'api-acc/account/expand/findaccountbyprojectid',
        data: {
          projectId: this.projectId,
        },
      })
        .then(
          (response) => {
            if (!response.data.hasError) {
              this.accountInfoObj = response.data.result
            } else {
              this.$message({
                message: response.data.errorMsg,
                type: 'error',
              })
            }
          },
          (response) => {
            this.$message({
              message: '数据请求失败',
              type: 'error',
            })
          }
        )
        .catch((error) => {})
    },
  },
}
</script>
<style lang="less" scoped>
.contentBox {
  width: 100%;
  height: 100%;
  padding: 0px 10px 10px 10px;
}
.container {
  width: 100%;
  height: 100%;
  padding: 16px 16px;
  overflow-y: auto;
  background-color: rgba(0, 0, 0, 0.4);
  cursor: pointer;
  .title {
    width: 100%;
    height: 30px;
    line-height: 30px;
    color: #5bfcf4;
    &::before {
      content: '';
      display: inline-block;
      height: 4px;
      width: 4px;
      border-radius: 50%;
      background: #5bfcf4;
      position: relative;
      top: -4px;
    }
    span {
      font-size: 16px;
      // font-family: Source Han Sans CN;
      font-weight: 400;
      color: #5bfcf4;
      margin-left: 6px;
    }
  }
  .accountInfoList {
    width: 100%;
    overflow: auto;
    padding: 13px 0px;
    .item {
      width: 100%;
      height: 31px;
      font-size: 12px;
      color: #b8e8fa;
      .itemIcon {
        width: calc(50% - 7.5px);
        height: 100%;
        padding: 0px 8px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: 1px solid #01b0ff;
        background: linear-gradient(
          0deg,
          rgba(19, 235, 241, 0.2) 0%,
          rgba(19, 240, 249, 0.2) 100%
        );
        // opacity: 0.6;
        border-radius: 5px;
        .information {
          color: #5bfcf4;
        }
        .noInformation {
          color: #fb3839;
        }
      }
    }
    .item:last-child {
      margin-top: 5px;
    }
  }
  .numberAccount {
    width: 100%;
    padding: 0px 30px;
    ul {
      display: flex;
      justify-content: space-between;
      align-items: center;
      li {
        width: 160px;
        height: 87.8px;
        display: flex;
        text-align: center;
        flex-flow: column; //垂直排列
        justify-content: center; //两端对齐
        background: url('../../assets/numberAccountbg.png') center center
          no-repeat;
        background-size: 100% 100%;
        .amountzhuanghu {
          font-family: Source Han Sans CN;
          font-weight: 400;
          color: #f7f2ea;
          background: linear-gradient(180deg, #fbcf34 0%, #ff9b58 100%);
          -webkit-background-clip: text;
          -webkit-text-fill-color: transparent;
        }
        .namezhuanghu {
          font-size: 12px;
          font-family: Source Han Sans CN;
          font-weight: 400;
          color: #b8e8fa;
        }
      }
    }
  }
}
.itemContent {
  font-size: 12px;
  font-family: Source Han Sans CN;
  font-weight: 300;
  color: #5bfcf4;
}
</style>
